<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
<meta charset="UTF-8" />
<title>亲友圈限制入座</title>
<script src="/socket.io.js"></script>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
    $(function(){
        let club, roomid,seatIndex, userId,lastMopai,endAccount;
        let openBtn  = $("#openBtn");
        let createBtn = $("#createBtn")
        let loginBtn = $("#loginBtn")
        let sitDownBtn = $("#sitdownBtn")
        let exitBtn = $("#exitBtn")
        let reconnectBtn = $("#reconnectBtn")
        let roomListBtn = $("#room_list")
        let disReqBtn = $("#req_dis");
        let agreeBtn = $("#agree_dis")
        let enterRoomBtn = $("#enter_room")
        let pokersBtn = $("#next_pokers")
        let recordBtn = $("#recordBtn")
        let clubStatBtn = $("#clubStatBtn")
        let changeConfBtn = $("#changeConfBtn")
        let rankBtn = $("#rankBtn")
        let chiBtn = $("#chiBtn")
        let rankDetailBtn = $("#rankDetailBtn");
        let clubCloseBtn = $("#clubCloseBtn")
        let clubNoticeBtn = $("#clubNoticeBtn")
        let setBugPaiBtn = $("#setBugPaiBtn")
        var socket = io("127.0.0.1:32510"); //通过ip和端口建立一个socket client
        let num = 0;
        // setInterval(function(){
        //     window.location.reload()
        // },1000)
        var hash = window.location.hash, inter;
        socket.on('connect', function(){
            console.log('connect a socket client');
        });
        
        socket.on("open_result", function(data){
            console.log("-------------open_result------------");
            console.log(data);
        })
        socket.on("club_limit_add_result", function(data){
            console.log("club_limit_add_result");
            console.log(data);
        })
        let clubId = 745177

        $("#openBtn").click(function(){
            socket.emit("open", {userId:138549})
        })
        $("#limitAdd").click(function(){
            console.log(1111);
            socket.emit("club_limit_add", {
                clubId,
                uids:[138552,138553,138161,138554],
                name:"123",
                type:1,
            })
        })

        $("#limitRemove").click(function(){
            console.log("22222222222222222");
            socket.emit("club_limit_remove", {
                clubId,
                uids:[137794],
                type:2
            });
        })
        socket.on("club_limit_remove_result", function(data){
            console.log("club_limit_remvoe_result");
            console.log(data);
        })

        $("#limitlist").click(function(){
            socket.emit("club_limit_list", {clubId, type:1});
        })
        
        socket.on("club_limit_list_result", function(data){
            console.log("club_limit_list_result");
            console.log(data);
        });

        $("#limitupdate").click(function(){
            socket.emit("club_limit_update", {
                clubId,
                uids:[137794],
                type:2
            })
        })
        socket.on("club_limit_update_result", function(data){
            console.log("club_limit_update_result");
            console.log(data);
        })

        $("#change").click(function(){
            socket.emit("club_conf_attribute",{
                clubId:745177,
                abc:1
            });
        })
    })
</script>
</head>
<body>
    <input type="text" name="userId" id="userId" value="138549"/> 
    <input id="openBtn" type="button" value="open"/></br>
    <input id="limitAdd" type="button" value="添加"></br>
    <input id="limitRemove" type="button" value="删除"></br>
    <input id="limitlist" type="button" value="列表"></br>
    <input id="limitupdate" type="button" value="修改"></br>
    <input id="change" type="button" value="改变亲友圈属性"></br>
</body>
</html>
